﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Album.aspx.cs" Inherits="Admin_Album_Album" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <br />
    <asp:Button ID="Button1" CssClass="buttonblue" PostBackUrl="~/Admin/Album/AlbumDetail.aspx" runat="server" Text="Thêm Album" />

    <br />
    <br />
    <h1>Album</h1>
    <asp:GridView ID="gvCateProducts" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="CateID" DataSourceID="odsCateProducts" ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="CateID" HeaderText="Mã" InsertVisible="False" ReadOnly="True" SortExpression="CateID">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Title" HeaderText="Tên danh mục" SortExpression="Title">
                <ItemStyle HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Hình đại diện" SortExpression="Image">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" Height="50px" ImageUrl='<%# "~/UserUploads/Product/"+ Eval("Image") %>' />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:BoundField DataField="ParentID" HeaderText="Danh mục" SortExpression="ParentID">
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Order" HeaderText="Vị trí" SortExpression="Order">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Status" HeaderText="Trạng thái" SortExpression="Status">
                <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <asp:TemplateField HeaderText="Xử lý">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("CateID","~/Admin/Album/AlbumDetail.aspx?CateID={0}") %>' Font-Bold="True">Sửa Album </asp:HyperLink>
<%--                    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("CateID") %>' Font-Bold="True" OnClientClick="return confirm('Are you sure you want delete');"> Xóa Album</asp:LinkButton>--%>
                    |
                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("CateID","~/Admin/Album/Image.aspx?CateID={0}") %>' Font-Bold="True">Sửa Hình </asp:HyperLink>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>

    <asp:ObjectDataSource ID="odsCateProducts" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByParentAll" TypeName="HNCDataSetTableAdapters.CategoryTableAdapter" UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_CateID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Title_en" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Description_en" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Content_en" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="ParentID" Type="Int32" />
            <asp:Parameter Name="AddDate" Type="DateTime" />
            <asp:Parameter Name="AddBy" Type="String" />
            <asp:Parameter Name="Order" Type="Int32" />
            <asp:Parameter Name="Status" Type="Boolean" />
            <asp:Parameter Name="SEOUrl" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="8" Name="ParentID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Title_en" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Description_en" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Content_en" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="ParentID" Type="Int32" />
            <asp:Parameter Name="AddDate" Type="DateTime" />
            <asp:Parameter Name="AddBy" Type="String" />
            <asp:Parameter Name="Order" Type="Int32" />
            <asp:Parameter Name="Status" Type="Boolean" />
            <asp:Parameter Name="SEOUrl" Type="String" />
            <asp:Parameter Name="Original_CateID" Type="Int32" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    </asp:Content>

